#-*- coding: utf-8 -*-
import numpy as np
from pylab import *
import matplotlib.pyplot as plt
from matplotlib.ticker import  MultipleLocator

def drawOneLine(x,y,ax,color="red",label="NoLab"):
    if x is None:
       x = [i for i in range(len(y))]
    ax.plot(x, y, color=color, label=label)

def drawVertical(x,ax,max,min=0):
    ax.plot([x,x],[min*1.1,max*1.1],label=str(x))


def drawPoint(x,y,ax):
    ax.plot(x,y,'ro')

def drawLines(x,y,ax):
    if x is None:
        x = [i for i in range(len(y[0]))]
    for i,val in enumerate(y):
        ax.plot(x,val,label = i)

if __name__ == "__main__":

    y = [
		<#list original.data as v>${v},</#list>	
	]
    max = max(y)
    min = min(y)

    peaks = [<#list peaks as v>${v.x},</#list>]

    xmajorLocator = MultipleLocator(50)
    ax = plt.subplot(1, 2, 1)
    ax.xaxis.set_major_locator(xmajorLocator)

    drawOneLine(None,y,ax)
    for x in peaks:
        drawVertical(x,ax,max,min)


    ax2 = plt.subplot(1,2,2)

    smoothed = [
       <#list smoothed as img>
			[  <#list img.data as v>${v},</#list>],
		</#list>
    ]

    drawLines(None,smoothed,ax2)
    plt.legend()
    plt.show()



